package com.hxcoder.cms.controller;

import com.hxcoder.cms.entity.CrmBanner;
import com.hxcoder.cms.service.CrmBannerService;
import com.hxcoder.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author hxcoder
 */
@Api(tags = "前台banner管理")
@RestController
@RequestMapping("/cms/bannerfront")
public class BannerFrontController {

    @Autowired
    private CrmBannerService bannerService;

    @ApiOperation(value = "查询所有banner")
    @GetMapping("getAllBanner")
    public R getAllBanner() {

        List<CrmBanner> list = bannerService.selectAllBanner();
        return R.ok().data("list", list);
    }
}